home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Essentials / MacApp Documentation / MacApp.TECH$ Archives / 1990 / Jun 90 / MacApp.Tech$ 6⁄8⁄90 / 1416-New Poject TFloatGri-Jun90 < prev    next >
Encoding:
Text File  |  1991-03-06  |  3.4 KB  |  85 lines  |  [TEXT/GEOL]

  1. Item    4199271                         7-June-90        16:04PDT
  2.  
  3. From:   D5780                           Stat-Ease, Robert Altman,PRT
  4.  
  5. To:     MACAPP.TECH$                    MacApp Technical
  6.         MOOF                            Rollin, Keith A
  7.  
  8. Sub:    New Poject: TFloatGridView
  9.  
  10. Fellow MacApp-ites,
  11.  
  12. I wish to announce a new classroom project and to solicite help and/or advice
  13. for that same project.
  14.  
  15. The project is this: Create a spreadsheet style editor that allows in-place
  16. editing of the cells.  To accomplish this, we use a GridView object coupled
  17. with a "floating" TEditText object.  The GridView handles the display,
  18. scrolling, and selection of text (or whatever).  A floating TEditText handles
  19. all the editing (and validation).  See Keith Rollins article "Children of the
  20. DogCow: TFloatingGridView" in Frameworks, September 1989 (Vol. 3, Num. 3) for a
  21. discussion of a similar project.
  22.  
  23. I am uploading an unit called UFloatGridView to the classroom area.  The unit
  24. contains the entire implementation of the floating GridView.  Unfortunately, I
  25. don't have a "shell" application to use for testing this unit at this point in
  26. time.
  27.  
  28. There are two immediate problems to tackle with this project.
  29.  
  30. First, the TEditText object (our floating editor) is too specific to text.  I
  31. was thinking of replacing that with an object TValidText - which had a validate
  32. method so that other object could be descended from it.  The validate method
  33. would default to TRUE - in all other respects, this would be the same as a
  34. TEditText.
  35.  
  36. Second, I am currently trying to fix the editor so that it handles highlighting
  37. correctly.  It is possible to disable TGridView's highlighting abilities be
  38. overriding CellsToPixels (Call SetEmptyRgn); this is necessary because the
  39. TEditText must handle the highlighting for editing purposes.  However, this
  40. approach prevents the GridView from highlighting the currently selected cell
  41. while the mouse button is depressed.  It seems intuitive that the currently
  42. pointed-at cell should be highlighted while the user is "roaming" around the
  43. spreadsheet with the mouse button down.  A possible solution is to keep a state
  44. variable (isFloating) and use the folowing code for CellsToPixels:
  45.  
  46. procedure TFloatGridView.CellsToPixels(theCells,thePixels:RgnHandle); OVERRIDE;
  47.  
  48.    begin
  49.    if isFloating then
  50.    Inherited CellsToPixels(theCells, thePixels)
  51.    else
  52.    SetEmptyRgn(thePixels);
  53.    end;
  54.  
  55. In this way, CellsToPixels will act differently depending on how we want it to
  56. behave.  Here's the catch: when do we set isFlaoting to true?  Answer: on a
  57. MouseDown within the bounds on the GridView but outside of the EditText.
  58. Locating the MouseDown event (where it happened) seems easy (using MacApp's
  59. Target chain), however, I haven't figured out how to trap the MouseDown event -
  60. and I fear that it might be ugly and unMacAppish.
  61.  
  62. There's the project and the problem.
  63.  
  64. ----------------------------------------------------------------------------
  65.  
  66. The Project:        TFloatGridView
  67.  
  68. Project leader:     Robert D. Altman
  69. Voice access:       612-378-9449 (Central Time)
  70. AppleLink:          D5780 (may change in the near future)
  71. MacApp version:     2.0ß9
  72. Initial release:    June 7, 1990
  73. Last update:        June 7, 1990
  74. Current version:    1.0
  75.  
  76. ----------------------------------------------------------------------------
  77.  
  78. Looking forward to a really neat unit,
  79.  
  80. Robert D. Altman
  81. Stat-Ease, Inc.
  82. Minneapolis, MN
  83.  
  84.  
  85.